UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K92/brwXLFnljt9dgDOukQo86NLD1Y22/S2cp5PjC3c='
WHERE
key_id = '6d9881b6f873b20d0a9b5df82a3c8fa168bd96659e29ac754a7e235b3f80edb1'
AND (
token = 'K92/brwXLFnljt9dgDOukQo86NLD1Y22/S2cp5PjC3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)