UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1PI7ovQ1mFq2j7B0FcInWgYH9prf92r4EYdYsyqmHUM='
WHERE
key_id = '99185004633bc4773fb69cabc49ce6c2ac921b7562634a283bb4dd172d76c46e'
AND (
token = '1PI7ovQ1mFq2j7B0FcInWgYH9prf92r4EYdYsyqmHUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)