UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOxT5Fm+TUKwklafksIUQ01pPATRTh7XI7sUjXfKdOs='
WHERE
key_id = '1e427b96ae520903f80eb42482c8d9c6b71981a657ab92f62ac049e2aa26f99c'
AND (
token = 'sOxT5Fm+TUKwklafksIUQ01pPATRTh7XI7sUjXfKdOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)