UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p6HDXlvO4LkACNWo3XdSHbqmMJr3DJLPlXwuZLVr/iE=' 
WHERE 
  key_id = '983395b11fac8ea8a2bd1d3176a1cb8b709b707514a71405cfe6eceacb57c2c0' 
  AND (
    token = 'p6HDXlvO4LkACNWo3XdSHbqmMJr3DJLPlXwuZLVr/iE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042