UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mw8yWYrcxxG+awjzsg4toX4q9Awyp2Qq9YC8qkEyq1s='
WHERE
key_id = '89b8e5eabab57485cf30c8790af2dcc5b424fcc08aed588a10ef3ae926cd9cda'
AND (
token = 'Mw8yWYrcxxG+awjzsg4toX4q9Awyp2Qq9YC8qkEyq1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)