UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vK93sg6+CD3syiOm9C/W94YW9VFqUUl0MTLPyRxnhW0=' 
WHERE 
  key_id = 'dc99e7aa78db426fece3df976c9cd0999faddabf24fcd1b7bf5c5cdb833b0e3e' 
  AND (
    token = 'vK93sg6+CD3syiOm9C/W94YW9VFqUUl0MTLPyRxnhW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026