UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/m4WLpHBgjf2IXVSIcetuvbyVi8iF4OfWjzYtO7kMo='
WHERE
key_id = '5e1d539444609ec1828d989f6a4dda9becd8ee933e3478747e524dc6f7f786d0'
AND (
token = '2/m4WLpHBgjf2IXVSIcetuvbyVi8iF4OfWjzYtO7kMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)