UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rfx/2cWY1tzuozFhtqlepbam7+zqV1L7ZV5+huVg7+I='
WHERE
key_id = '1406fe9a05344a279923f4e265deb0179599540b0d637d3b545ed1cc9fa261a6'
AND (
token = 'Rfx/2cWY1tzuozFhtqlepbam7+zqV1L7ZV5+huVg7+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)