UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ngqVlOEusbLpzWUIOv0CrAzLb3rdYft+uZnrpCW/4w='
WHERE
key_id = '30b3876c4357c173561a2b4480f5f5a25d0da0f77d67049db0dea2272d3c3b33'
AND (
token = '/ngqVlOEusbLpzWUIOv0CrAzLb3rdYft+uZnrpCW/4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)