UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b9Oy5CtWcXNuZMKsDxPi90azEA4fPd/9RB2MkzmsgzY='
WHERE
key_id = '46cee7c2abe9bfb41a060e405a7895fa007584f8a83aa4fb85ed081eca31ac83'
AND (
token = 'b9Oy5CtWcXNuZMKsDxPi90azEA4fPd/9RB2MkzmsgzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)