UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zxJnYmNOI1OQSvUJqmXv8lKdMkPR6BPJ/tnwF5fmJSk='
WHERE
key_id = 'b1dad91049b74b2e69586df65522aa904723dad687deeed724752d26209c19bd'
AND (
token = 'zxJnYmNOI1OQSvUJqmXv8lKdMkPR6BPJ/tnwF5fmJSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)