UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6XhSBxMhJ8Fst4ze0SQHnTs/MG0ds7CDHnVebTUcM0w=' 
WHERE 
  key_id = 'edba86a710632f57145ad07fdfe101d86e4774ff31f061903ddd5f1ab6d3482a' 
  AND (
    token = '6XhSBxMhJ8Fst4ze0SQHnTs/MG0ds7CDHnVebTUcM0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038