UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BiSPVAXPRlQlxwuNjPSKQQDApC2EQg+vW9msPy6AMk8='
WHERE
key_id = '434c54574162ab58edd9fb97f56f5946932fcbdaad6983c466c78ab357d8ada7'
AND (
token = 'BiSPVAXPRlQlxwuNjPSKQQDApC2EQg+vW9msPy6AMk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)