UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RFpVvhFt8oZHYwsqMHexSnQkVec4m4zwrP99OolaoQ0='
WHERE
key_id = '811b2c6f9a7030f93fa75559b7f6b5328b54963183ab4ce50a49b6b83caa1d99'
AND (
token = 'RFpVvhFt8oZHYwsqMHexSnQkVec4m4zwrP99OolaoQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)