UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3beYtQNUI1+rVx6N/bgW4IuhLufpaIiBR4gADMhfIlk='
WHERE
key_id = 'e9ca6b9271a35c00a407ae09442601d65ef1deb657ec607cb0724157f3b82277'
AND (
token = '3beYtQNUI1+rVx6N/bgW4IuhLufpaIiBR4gADMhfIlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)