UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8CCXtEP2xFF//WlaPYuPyeXZyqUqAdiujufA0hKVL2A='
WHERE
key_id = 'e6487b60082e41cf687dfb8d80dfe869e0837340e439e6f0e481ce90ed0c2f6a'
AND (
token = '8CCXtEP2xFF//WlaPYuPyeXZyqUqAdiujufA0hKVL2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)