UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jTVVqXWAqda12h6mhi3UeIGugiwtTUhtt7yVkmN6An4='
WHERE
key_id = 'da466461bb742d4ff8268ed7567cfa84b9d61d2ad71091652eb9d08eda1ec150'
AND (
token = 'jTVVqXWAqda12h6mhi3UeIGugiwtTUhtt7yVkmN6An4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)