UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpI/XiHCXANW5ahhSsU+eyxahW4KbY98O84lsgaJVWc='
WHERE
key_id = '61fc31dbf7c3eb94b4c74036d4c3a69f3fd0d8cd4ce3e2e55b88fcef9a1fc60a'
AND (
token = 'RpI/XiHCXANW5ahhSsU+eyxahW4KbY98O84lsgaJVWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)