UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/kfj6E4szz5qR3vU8iauNr0mCIItvatyuKv8ObbSnDw=' 
WHERE 
  key_id = '8ade6a7e959dee42551e3282fa4be1e30db14f50b27482970bdddf6cd7994705' 
  AND (
    token = '/kfj6E4szz5qR3vU8iauNr0mCIItvatyuKv8ObbSnDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027