UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YZmyJb78UZHUtiNmrnsooXupMZyNBkIELjJF5jJ9B/E='
WHERE
key_id = '033f39d3ed9e0cb33a11fb26170eae5f751f2ea4ef8309fae9bfa975f1da9fe4'
AND (
token = 'YZmyJb78UZHUtiNmrnsooXupMZyNBkIELjJF5jJ9B/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)