UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0BNquf0rdqXYv8a8N+XmCSinJBK++iTEEr1GL4LDpW4='
WHERE
key_id = '05931ddc0740f47f23172406261e0675fd4a10b3afaa3985c5b9f35128a05aad'
AND (
token = '0BNquf0rdqXYv8a8N+XmCSinJBK++iTEEr1GL4LDpW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)