UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ao8jPM8T6Upvp1N+K+yNDbVgagdf8Q6eR5p4Xs0TPv4='
WHERE
key_id = '2cee01a670c297b2860846870012c6af2e164302276bb2dd68df36385ddb8cec'
AND (
token = 'Ao8jPM8T6Upvp1N+K+yNDbVgagdf8Q6eR5p4Xs0TPv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)