UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9eZDKhAi+lZdqIuby/GRjVnCiRG0bBnTmqnNsRlyEkM='
WHERE
key_id = '8fecaaa660a0f1037157fb5d1f4d2504a25ce44beb8ca9ad0a0b0731fa26dc78'
AND (
token = '9eZDKhAi+lZdqIuby/GRjVnCiRG0bBnTmqnNsRlyEkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)