UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5lIXaN5mNcMwKs4HfwDTj/05ved+/g3ozA85eSS5Jw8='
WHERE
key_id = '89ce8ec279dcad1450b84dc3c155be41ad37ad4096b6daefa6646c6c3cd683b1'
AND (
token = '5lIXaN5mNcMwKs4HfwDTj/05ved+/g3ozA85eSS5Jw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)