UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '17T8+vqrjc8ZjwL1UnpSVmOyHMaQglISWUwFmygTa8E=' 
WHERE 
  key_id = '53734978986d7b5c4a3aebebd8de6f690aadccf8d13108a7b60bbcc39c4dad11' 
  AND (
    token = '17T8+vqrjc8ZjwL1UnpSVmOyHMaQglISWUwFmygTa8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036