UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GAxTZH/mVrOVS3ts++A5kVWX+ZVUwHpNPSVCSuvYp0Q='
WHERE
key_id = '30f291ad52bd8358bbae95babb41235745f521e78d39f744c7283fb68aaa6856'
AND (
token = 'GAxTZH/mVrOVS3ts++A5kVWX+ZVUwHpNPSVCSuvYp0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)