UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqtkfTaBMI1F1/lrhtntUooVUX0D4TNdGPNjYESKXZE=' 
WHERE 
  key_id = '26d8bf0bbe7fb3cc75b798f3b4023daca07478bc56e91bf568e60dab499d21c8' 
  AND (
    token = 'xqtkfTaBMI1F1/lrhtntUooVUX0D4TNdGPNjYESKXZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022