UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+aauWfMA8j9mHewu2wPvZmZFqoL1QHahSeKwBMaq4BM='
WHERE
key_id = '852e62acff7a5b5e5b5d6c3cb48e417d983c7ff6b5c81c976747adee8f4d254f'
AND (
token = '+aauWfMA8j9mHewu2wPvZmZFqoL1QHahSeKwBMaq4BM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)