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

Query time 0.00035