UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxTjlBA7B7E4RwXWpHC7UgYwU7zm7SllzG9gdZT4FoI='
WHERE
key_id = '8f0923c5db0d19dfcec4235556e148261106db6867aeb54677aaa03431d80e53'
AND (
token = 'NxTjlBA7B7E4RwXWpHC7UgYwU7zm7SllzG9gdZT4FoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)