UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Z7VcnsMF9vRrHamBQfneERRW4cubx5cEbwU8BbFZYQ=' 
WHERE 
  key_id = '44d94268777e29fb2fa0bb393b779c2cc3afb13f4c10d69cfac7feb289f50de4' 
  AND (
    token = '5Z7VcnsMF9vRrHamBQfneERRW4cubx5cEbwU8BbFZYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040