UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9bFYCp43/LUgR6E51iw3260rb/Z7ws9mc8V6ElFaBX4='
WHERE
key_id = 'e3252520b4e02973988591ae4a728cab87502e9df54be141d489bbc56d079d3d'
AND (
token = '9bFYCp43/LUgR6E51iw3260rb/Z7ws9mc8V6ElFaBX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)