UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'USyBaEWRZWcpE01RzvMbJgJgyTWs5Y3YcWwGTluL54w='
WHERE
key_id = '77cd526ff9d66f3bdd1fddad744959124e505f1288e19253f77523bef88e3b76'
AND (
token = 'USyBaEWRZWcpE01RzvMbJgJgyTWs5Y3YcWwGTluL54w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)