UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MdjWGb40JuwE13DbVI8/XkCeS8VoAEoDrPZrNhtapj4='
WHERE
key_id = '2bba2c4e26fb6ebf09c1478e2c6a11414518ca8414a3b6cb828be0e25b4e7935'
AND (
token = 'MdjWGb40JuwE13DbVI8/XkCeS8VoAEoDrPZrNhtapj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)