UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GnGNfslvejTSfB/8qdGOcM298MkjLoWHC1EgvhmK1P4=' 
WHERE 
  key_id = '0c1ce5c815da442969d066ada92b5694c95559ca666c9f04c6841db19b8ed902' 
  AND (
    token = 'GnGNfslvejTSfB/8qdGOcM298MkjLoWHC1EgvhmK1P4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030