UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmPs/HKogdyxSfaugBcDl9f2Q6KFc+D00QV3m3d2UrU='
WHERE
key_id = '9e90be6205e892e3bceab11f527c8ddd0aa84595eb7a7455ca53256bb1edf433'
AND (
token = 'mmPs/HKogdyxSfaugBcDl9f2Q6KFc+D00QV3m3d2UrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)