UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ZM/XOGenMfQ8FSEJ1lvc5N8LB9yoMcGyaF+xaIPO3M='
WHERE
key_id = 'bda0b3a823faf28d8bb24b83c40b808ef68668fe8c8253855cc5fb8315113b53'
AND (
token = '0ZM/XOGenMfQ8FSEJ1lvc5N8LB9yoMcGyaF+xaIPO3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)