UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IlERblU81F0vagawpwl2mzHMgfQUF5LquVNoIwteMNg='
WHERE
key_id = '9e109f3f66907434efe55f8f247a7447793fa3c9ac7531d17f70184d198b9da6'
AND (
token = 'IlERblU81F0vagawpwl2mzHMgfQUF5LquVNoIwteMNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)