UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n4EgSqDBTCYwCoCn/rmxdODvfcfAdIy7/pSKJwnCRGk='
WHERE
key_id = '4c326263a26b1ac67321fdd8ab2178b02ff9026ef01fc8b67b17be74232a4882'
AND (
token = 'n4EgSqDBTCYwCoCn/rmxdODvfcfAdIy7/pSKJwnCRGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)