UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QuprLgMlvr9E+JLUbdgaT6ck/rW8QJeRvW3mPVZDxlc='
WHERE
key_id = '8f0e34aaa321dc81dda6cc9f2ed755697cb2c264ee462cba71fd7bebc5ed0521'
AND (
token = 'QuprLgMlvr9E+JLUbdgaT6ck/rW8QJeRvW3mPVZDxlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)