UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7hsNNtK6SYTAUxE5gB7UTzvXlvYHZa84//sx0gvoOuw=' 
WHERE 
  key_id = '4b342c6be9712146b306fb30e06c96ff43fbc721cbffbeb77e0a99074071cb61' 
  AND (
    token = '7hsNNtK6SYTAUxE5gB7UTzvXlvYHZa84//sx0gvoOuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019