UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZCTNK2OfRVvb9QlzohocQdzw1g0XWO78vCXcwZvMGl0='
WHERE
key_id = '1f64a807adafc400fd714d37ecb87d340ae9e656aef2979a77dbe96cd80380fa'
AND (
token = 'ZCTNK2OfRVvb9QlzohocQdzw1g0XWO78vCXcwZvMGl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)