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