UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NJ71FOJYvAZrxNTNC7Jb1+5t/Hhyv3hF5BV7Yf/3PAM='
WHERE
key_id = '2e0d209c64de22915c6cec5417d35ea9095e8c1a7cd8ad4bc64099cb83ad3175'
AND (
token = 'NJ71FOJYvAZrxNTNC7Jb1+5t/Hhyv3hF5BV7Yf/3PAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)