UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F9R7KD+sozl9RLXRmUD5HOqWOcOdIxehIvK72F2+WSk=' 
WHERE 
  key_id = '19ac308e0c35e39d396ab821ad9090e4ca9283b792573717127bf8ea1a147229' 
  AND (
    token = 'F9R7KD+sozl9RLXRmUD5HOqWOcOdIxehIvK72F2+WSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018