UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Te0EdqsD+u68CRGZlxSlVO4BKEyhN9tIpfTQLzwN+u0='
WHERE
key_id = '730a305035ee463f0d3e88f9c3657383544a20b4f87373fd6c31c3754a99bb85'
AND (
token = 'Te0EdqsD+u68CRGZlxSlVO4BKEyhN9tIpfTQLzwN+u0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)