UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JxTqMqkRdK3mf5m6pumhHcuGfKgh+pk6jQMyRGwkWI='
WHERE
key_id = 'b179054161e086f862b257f4e415bab4c644c74ca5a156043ea5040a8654f8eb'
AND (
token = '6JxTqMqkRdK3mf5m6pumhHcuGfKgh+pk6jQMyRGwkWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)