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