UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SllGzUlV8TTWRNVBKGTnV5I42HXaVbAT8xvVn0byza4='
WHERE
key_id = '7617838fa2851ebc553d15ef89003d8049acb5b99055731c5638bf7ef096a1cf'
AND (
token = 'SllGzUlV8TTWRNVBKGTnV5I42HXaVbAT8xvVn0byza4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)