UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1H/hDzjZcZmFwbnHoemVYARqBPlYYOYi1qgNINe6K5g='
WHERE
key_id = '76516d27ca40b9e42ce39b2a56e78e849017df61c278ad121d2d04cda6fd336d'
AND (
token = '1H/hDzjZcZmFwbnHoemVYARqBPlYYOYi1qgNINe6K5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)